package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMplsQosflowMapper;
import com.ruoyi.net.domain.ElementBusiMplsQosflow;
import com.ruoyi.net.service.IElementBusiMplsQosflowService;

/**
 * 网元-业务-mpls-qos流量监管Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMplsQosflowServiceImpl implements IElementBusiMplsQosflowService 
{
    @Autowired
    private ElementBusiMplsQosflowMapper elementBusiMplsQosflowMapper;

    /**
     * 查询网元-业务-mpls-qos流量监管
     * 
     * @param id 网元-业务-mpls-qos流量监管主键
     * @return 网元-业务-mpls-qos流量监管
     */
    @Override
    public ElementBusiMplsQosflow selectElementBusiMplsQosflowById(String id)
    {
        return elementBusiMplsQosflowMapper.selectElementBusiMplsQosflowById(id);
    }

    /**
     * 查询网元-业务-mpls-qos流量监管列表
     * 
     * @param elementBusiMplsQosflow 网元-业务-mpls-qos流量监管
     * @return 网元-业务-mpls-qos流量监管
     */
    @Override
    public List<ElementBusiMplsQosflow> selectElementBusiMplsQosflowList(ElementBusiMplsQosflow elementBusiMplsQosflow)
    {
        return elementBusiMplsQosflowMapper.selectElementBusiMplsQosflowList(elementBusiMplsQosflow);
    }

    /**
     * 新增网元-业务-mpls-qos流量监管
     * 
     * @param elementBusiMplsQosflow 网元-业务-mpls-qos流量监管
     * @return 结果
     */
    @Override
    public int insertElementBusiMplsQosflow(ElementBusiMplsQosflow elementBusiMplsQosflow)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMplsQosflow.getId())) {
            elementBusiMplsQosflow.setId(uuid);
        }
        elementBusiMplsQosflow.setCreateBy(SecurityUtils.getUsername());
        elementBusiMplsQosflow.setCreateTime(DateUtils.getNowDate());
        elementBusiMplsQosflow.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsQosflow.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsQosflowMapper.insertElementBusiMplsQosflow(elementBusiMplsQosflow);
    }

    /**
     * 修改网元-业务-mpls-qos流量监管
     * 
     * @param elementBusiMplsQosflow 网元-业务-mpls-qos流量监管
     * @return 结果
     */
    @Override
    public int updateElementBusiMplsQosflow(ElementBusiMplsQosflow elementBusiMplsQosflow)
    {
        elementBusiMplsQosflow.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsQosflow.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsQosflowMapper.updateElementBusiMplsQosflow(elementBusiMplsQosflow);
    }

    /**
     * 批量删除网元-业务-mpls-qos流量监管
     * 
     * @param ids 需要删除的网元-业务-mpls-qos流量监管主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsQosflowByIds(String[] ids)
    {
        return elementBusiMplsQosflowMapper.deleteElementBusiMplsQosflowByIds(ids);
    }

    /**
     * 删除网元-业务-mpls-qos流量监管信息
     * 
     * @param id 网元-业务-mpls-qos流量监管主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsQosflowById(String id)
    {
        return elementBusiMplsQosflowMapper.deleteElementBusiMplsQosflowById(id);
    }
}
